package com.alibaba.nacos.core.remote;

import com.alibaba.nacos.api.exception.NacosException;
import com.alibaba.nacos.api.remote.request.Request;
import com.alibaba.nacos.api.remote.request.RequestMeta;
import com.alibaba.nacos.api.remote.response.Response;
import lombok.SneakyThrows;

public abstract class RequestHandler<T extends Request, S extends Response> {

    @SneakyThrows
    public Response handleRequest(T request,
                                  RequestMeta meta) throws NacosException {
        return handle(request, meta);
    }

    public abstract S handle(T request,
                             RequestMeta meta) throws NacosException;

}

